function deepCopy(obj) {

    if (typeof obj !== 'object') {
        return obj;
    }
    let copy = {};
    let keys = [].concat(Object.keys(obj), Object.getOwnPropertySymbols(obj));
    for (let key of keys) {
        if (typeof obj[key] !== 'object') {
            copy[key] = obj[key];
        } else {
            copy[key] = deepCopy(obj[key]);
        }
    }
    return copy;
}

let obj1 = { name: 'foo', job: { name: 'bar', type: 'dev' }, func: function () { } }
let obj2 = deepCopy(obj1);
let func1 = () => { console.log('111') };
let func2 = deepCopy(func1)

console.log(obj1 === obj2);
console.log(obj1.func === obj2.func);
console.log(obj1.job === obj2.job);
console.log(func1 === func2);
console.log(typeof func2);
func2();